package com.hl.sfzy.exception;



import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hl.sfzy.utils.R;

/**
 * 全局异常统一处理
 */
@ControllerAdvice
public class GlobalExceptionHandler {
    @ResponseBody
    @ExceptionHandler(value = Exception.class)
    public R handle(Exception e) {
        e.printStackTrace();
        return R.failure(e.getMessage());
    }
}
